from fastapi import FastAPI
from config.dev import init_tortoise, close_tortoise

async def lifespan(app: FastAPI):
    # 初始化数据库连接
    await init_tortoise()
    yield
    # 关闭数据库连接
    await close_tortoise()